#ifndef __CLASS_TEMPERATURE_DETECT_H__
#define __CLASS_TEMPERATURE_DETECT_H__

#include <Protothread.hpp>
#include <NTC_Thermistor.h>
#include <SmoothThermistor.h>

#define DEFAULT_BCOEF 3950
#define DEFAULT_NOMINAL_RES 10000
#define DEFAULT_SERIAL_RES 10000

class Temperature : public Protothread
{
private:
    // ExpiryTimer _ex_timer;
    SmoothThermistor _ntc;
    int _last_temper;
    float _ftemp;
public:
    Temperature(uint32_t pin_adc = A0,
                double bCoef = DEFAULT_BCOEF,
                double nomRes = DEFAULT_NOMINAL_RES,
                double serialRes = DEFAULT_SERIAL_RES);

    virtual ~Temperature();

    virtual bool Run();

    float getTemp();
};

#endif //!__CLASS_TEMPERATURE_DETECT_H__